<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of bbNms</title>
  <meta name="keywords" content="bbNms">
  <meta name="description" content="Bounding box (bb) non-maximal suppression (nms).">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html &copy; 2003 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../m2html.css">
</head>
<body>
<a name="_top"></a>
<!-- menu.html detector -->
<h1>bbNms
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>Bounding box (bb) non-maximal suppression (nms).</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function bbs = bbNms( bbs, varargin ) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment"> Bounding box (bb) non-maximal suppression (nms).

 type=='max': nms of bbs using area of overlap criteria. For each pair of
 bbs, if their overlap, defined by:
  overlap(bb1,bb2) = area(intersect(bb1,bb2))/area(union(bb1,bb2))
 is greater than overlap, then the bb with the lower score is suppressed.
 In the Pascal critieria two bbs are considered a match if overlap&gt;=.5. If
 ovrDnm='min', the 'union' in the above formula is replaced with 'min'.

 type=='maxg': Similar to 'max', except performs the nms in a greedy
 fashion. Bbs are processed in order of decreasing score, and, unlike in
 'max' nms, once a bb is suppressed it can no longer suppress other bbs.

 type='cover': Perform nms by attempting to choose the smallest subset of
 the bbs such that each remaining bb is within overlap of one of the
 chosen bbs. The above reduces to the weighted set cover problem which is
 NP but greedy optimization yields provably good solutions. The score of
 each bb is set to the sum of the scores of the bbs it covers (the max can
 also be used). In practice similar to 'maxg'.

 type=='ms': Mean shift nms of bbs with a variable width kernel. radii is
 a 4 element vector (x,y,w,h) that controls the amount of suppression
 along each dim. Typically the first two elements should be the same, as
 should the last two. Distance between w/h are computed in log2 space (ie
 w and w*2 are 1 unit apart), and the radii should be set accordingly.
 radii may need to change depending on spatial and scale stride of bbs.

 Although efficient, nms is O(n^2). To speed things up for large n, can
 divide data into two parts (according to x or y coordinate), run nms on
 each part, combine and run nms on the result. If maxn is specified, will
 split the data in half if n&gt;maxn. Note that this is a heuristic and can
 change the results of nms. Moreover, setting maxn too small will cause an
 increase in overall performance time.

 Finally, the bbs are optionally resized before performing nms. The
 resizing is important as some detectors return bbs that are padded. For
 example, if a detector returns a bounding box of size 128x64 around
 objects of size 100x43 (as is typical for some pedestrian detectors on
 the INRIA pedestrian database), the resize parameters should be {100/128,
 43/64, 0}, see bbApply&gt;resize() for more info.

 USAGE
  bbs = bbNms( bbs, [varargin] )

 INPUTS
  bbs        - original bbs (must be of form [x y w h wt bbType])
  varargin   - additional params (struct or name/value pairs)
   .type       - ['max'] 'max', 'maxg', 'ms', 'cover', or 'none'
   .thr        - [-inf] threshold below which to discard (0 for 'ms')
   .maxn       - [inf] if n&gt;maxn split and run recursively (see above)
   .radii      - [.15 .15 1 1] supression radii ('ms' only, see above)
   .overlap    - [.5] area of overlap for bbs
   .ovrDnm     - ['union'] area of overlap denominator ('union' or 'min')
   .resize     - {} parameters for bbApply('resize')
   .separate   - [0] run nms separately on each bb type (bbType)

 OUTPUTS
  bbs      - suppressed bbs

 EXAMPLE
  bbs=[0 0 1 1 1; .1 .1 1 1 1.1; 2 2 1 1 1];
  bbs1 = bbNms(bbs, 'type','max' )
  bbs2 = bbNms(bbs, 'thr',.5, 'type','ms')

 See also <a href="bbApply.html" class="code" title="function varargout = bbApply( action, varargin )">bbApply</a>, nonMaxSuprList

 Piotr's Computer Vision Matlab Toolbox      Version 2.60
 Copyright 2014 Piotr Dollar.  [pdollar-at-gmail.com]
 Licensed under the Simplified BSD License [see external/bsd.txt]</pre></div>





<!-- Start of Google Analytics Code -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-4884268-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
<!-- end of Google Analytics Code -->

<hr><address>Generated by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" target="_parent">m2html</a></strong> &copy; 2003</address>
</body>
</html>
